<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>adspygoogle.common.SanityCheck</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="adspygoogle-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/google-api-dfp-python">DFP API Python Client Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="adspygoogle-module.html">Package&nbsp;adspygoogle</a> ::
        <a href="adspygoogle.common-module.html">Package&nbsp;common</a> ::
        Module&nbsp;SanityCheck
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="adspygoogle.common.SanityCheck-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module SanityCheck</h1><p class="nomargin-top"><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html">source&nbsp;code</a></span></p>
<p>Validation functions.</p>

<hr />
<div class="fields">      <p><strong>Author:</strong>
        api.sgrinberg@gmail.com (Stan Grinberg)
      </p>
</div><!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#ValidateRequiredHeaders" class="summary-sig-name">ValidateRequiredHeaders</a>(<span class="summary-sig-arg">headers</span>,
        <span class="summary-sig-arg">required_headers</span>)</span><br />
      Sanity check for required authentication elements.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateRequiredHeaders">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#IsConfigUserInputValid" class="summary-sig-name">IsConfigUserInputValid</a>(<span class="summary-sig-arg">user_input</span>,
        <span class="summary-sig-arg">valid_el</span>)</span><br />
      Sanity check for user input.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#IsConfigUserInputValid">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#ValidateConfigSoapLib" class="summary-sig-name">ValidateConfigSoapLib</a>(<span class="summary-sig-arg">soap_lib</span>)</span><br />
      Sanity check for SOAP library.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateConfigSoapLib">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#ValidateConfigXmlParser" class="summary-sig-name">ValidateConfigXmlParser</a>(<span class="summary-sig-arg">xml_parser</span>)</span><br />
      Sanity check for XML parser.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateConfigXmlParser">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#IsType" class="summary-sig-name">IsType</a>(<span class="summary-sig-arg">param</span>,
        <span class="summary-sig-arg">param_type</span>)</span><br />
      Check if parameter is of the right type.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#IsType">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#ValidateTypes" class="summary-sig-name">ValidateTypes</a>(<span class="summary-sig-arg">vars_tpl</span>)</span><br />
      Check types for a set of variables.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateTypes">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#ValidateOneLevelObject" class="summary-sig-name">ValidateOneLevelObject</a>(<span class="summary-sig-arg">obj</span>)</span><br />
      Validate object with one level of complexity.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateOneLevelObject">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="adspygoogle.common.SanityCheck-module.html#ValidateOneLevelList" class="summary-sig-name">ValidateOneLevelList</a>(<span class="summary-sig-arg">lst</span>)</span><br />
      Validate list with one level of complexity.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateOneLevelList">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="ValidateRequiredHeaders"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ValidateRequiredHeaders</span>(<span class="sig-arg">headers</span>,
        <span class="sig-arg">required_headers</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateRequiredHeaders">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Sanity check for required authentication elements.

All required authentication headers have to be set in order to make
successful API request.

Args:
  headers: dict Authentication headers.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="IsConfigUserInputValid"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">IsConfigUserInputValid</span>(<span class="sig-arg">user_input</span>,
        <span class="sig-arg">valid_el</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#IsConfigUserInputValid">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Sanity check for user input.

Args:
  user_input: str User input.
  valid_el: list List of valid elements.

Returns:
  bool True if user input is valid, False otherwise.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="ValidateConfigSoapLib"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ValidateConfigSoapLib</span>(<span class="sig-arg">soap_lib</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateConfigSoapLib">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Sanity check for SOAP library.

Args:
  soap_lib: str SOAP library to use.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="ValidateConfigXmlParser"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ValidateConfigXmlParser</span>(<span class="sig-arg">xml_parser</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateConfigXmlParser">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Sanity check for XML parser.

Args:
  xml_parser: str XML parser to use.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="IsType"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">IsType</span>(<span class="sig-arg">param</span>,
        <span class="sig-arg">param_type</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#IsType">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Check if parameter is of the right type.

Args:
  param: obj Parameter to check.
  param_type: type Type of the parameter to check against.

Returns:
  bool True if the parameter is of right type, False otherwise.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="ValidateTypes"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ValidateTypes</span>(<span class="sig-arg">vars_tpl</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateTypes">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Check types for a set of variables.

Args:
  vars_tpl: tuple Set of variables to check.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="ValidateOneLevelObject"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ValidateOneLevelObject</span>(<span class="sig-arg">obj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateOneLevelObject">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Validate object with one level of complexity.

Args:
  obj: dict Object to validate.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="ValidateOneLevelList"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ValidateOneLevelList</span>(<span class="sig-arg">lst</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="adspygoogle.common.SanityCheck-pysrc.html#ValidateOneLevelList">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">
Validate list with one level of complexity.

Args:
  lst: list List to validate.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="adspygoogle-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/google-api-dfp-python">DFP API Python Client Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
